package org.example.dao;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.example.domain.Test;

/**
 * @Author: tang
 * @Description:
 * @Date 2025/6/5 23:03
 */
public interface TestMapper extends BaseMapper<Test> {

    @Select({
            "select * from test "
    })
    @InterceptorIgnore(tenantLine = "1")
    IPage<Test> testPage(Page<Test> page);

    @Select({
            "select * from test where id = 1"
    })
    Test test();

    @Select({
            "select * from test where id = 1"
    })
//    @DS("slave")
    Test test01();

    @Select({
            "select * from test where id = 1"
    })
    @DS("mysql")
    Test test02();


    @Insert({
            """
            insert into test (id,name) value(null,'test001')
            """
    })
    @DS("mysql")
    int test0041();

    @Insert({
            """
            insert into test (id,name) value(null,'test001')
            """
    })
    int test0042();

}
